package com.heima.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.groups.Default;
import java.time.LocalDateTime;
import java.io.Serializable;

/**
 * (Category)实体类
 *
 * @author makejava
 * @since 2024-09-29 15:46:01
 */
public class Category implements Serializable {
    private static final long serialVersionUID = -98915639249439651L;
/**
     * ID
     */
    @NotNull(groups = Update.class)
    private Object id;
/**
     * 分类名称
     */
    @NotEmpty/*(groups = {Add.class, Update.class})*/
    private String categoryName;
/**
     * 分类别名
     */
    @NotEmpty/*(groups = {Add.class, Update.class})*/
    private String categoryAlias;
/**
     * 创建人ID
     */
    private Object createUser;
/**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
/**
     * 修改时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    //如果说某个校验项没有指定分组，默认为default分组
    //分组之间可以继承， A extended B ，那么A中用有B中的所有校验项
    //分组校验
    public interface Add extends Default {

    }

    public interface Update extends Default{

    }

    public Object getId() {
        return id;
    }

    public void setId(Object id) {
        this.id = id;
    }

    public String getCategoryName() {
        return categoryName;
    }

    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }

    public String getCategoryAlias() {
        return categoryAlias;
    }

    public void setCategoryAlias(String categoryAlias) {
        this.categoryAlias = categoryAlias;
    }

    public Object getCreateUser() {
        return createUser;
    }

    public void setCreateUser(Object createUser) {
        this.createUser = createUser;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }

}

